package com.hd.entity.activiti;

import com.fasterxml.jackson.annotation.JsonBackReference;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Task;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
/**
 * 流程基础实体类
 * @author hzhh123
 * 2018年7月30日下午3:41:45
 */
public class BaseVO implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 316538649837349799L;

    // 待办任务标识
    public final static String CANDIDATE = "candidate";

    // 受理任务标识
    public final static String ASSIGNEE = "assignee";

    // 运行中的流程表示
    public final static String RUNNING = "running";

    // 已结束任务标识
    public final static String FINISHED = "finished";

    //审批中
    public static final Integer PENDING = 1;
    public static final Integer PENDING_NUMBER = 1;
    //暂存
    public static final Integer TEMP_STOAGE=-1;
    //待审批
    public static final Integer WAITING_FOR_APPROVAL = 0;
    //审批成功
    public static final Integer APPROVAL_SUCCESS = 3;
    public static final Integer APPROVAL_SUCCESS_MUMBER = 3;
    //审批失败
    public static final Integer APPROVAL_FAILED = 5;
    public static final Integer APPROVAL_FAILED_NUMBER = 5;
    //申请调整
    public static final Integer APPROVAL_ADJUST=2;
    //暂存
    public static final String TEMPORARY_STORAGE="TEMPORARY_STORAGE";
    //作废
    public static final Integer INVALID=9;
    public static final Integer INVALID_NUMBER=9;
    //申请人id
    @Transient
    private String userid_;
    @JsonBackReference
    private String prevUserid;
    //申请人姓名
    @Transient
    private String userName_;
    //申请标题
    @Transient
    private String title_;
    //业务类型
    @Transient
    private String businessType_;
    
    private Integer status_;

    //对应业务的id
    @Transient
    private String businessKey_;
    //任务id
    @Transient
    private String taskId;
    //任务名称
    @Transient
    private String taskName;
   
    // 流程任务
    @JsonBackReference
    @Transient
    private Task task;
    //任务执行人
    private String assigneeOrCandidateUser;
    // 运行中的流程实例
    @JsonBackReference
    private org.activiti.engine.runtime.ProcessInstance processInstance;
    //流程实例ID
    private String processInstanceId_;
    private Date startTime_;
    private Date endTime_;
    //删除原因
    private String deleteReason_;
    //版本
    private Integer version_; 

    // 历史的流程实例
    @JsonBackReference
    private HistoricProcessInstance historicProcessInstance;

    // 历史任务
    @JsonBackReference
    private HistoricTaskInstance historicTaskInstance;

    // 流程定义
    @JsonBackReference
    private ProcessDefinition processDefinition;
    /**
	 * 候选人/组名称
	 */
	private String candidateNames; // 人或候选人或组的名称
	/**
	 * 候选人id集合
	 */
	private String candidateIds;
	public String getUserid_() {
		return userid_;
	}
	public void setUserid_(String userid_) {
		this.userid_ = userid_;
	}
	public String getUserName_() {
		return userName_;
	}
	public void setUserName_(String userName_) {
		this.userName_ = userName_;
	}
	public String getTitle_() {
		return title_;
	}
	public void setTitle_(String title_) {
		this.title_ = title_;
	}
	public String getBusinessType_() {
		return businessType_;
	}
	public void setBusinessType_(String businessType_) {
		this.businessType_ = businessType_;
	}
	public String getBusinessKey_() {
		return businessKey_;
	}
	public void setBusinessKey_(String businessKey_) {
		this.businessKey_ = businessKey_;
	}
	public String getTaskId() {
		return taskId;
	}
	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	public String getTaskName() {
		return taskName;
	}
	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	public String getCandidateNames() {
		return candidateNames;
	}
	public void setCandidateNames(String candidateNames) {
		this.candidateNames = candidateNames;
	}
	public String getCandidateIds() {
		return candidateIds;
	}
	public void setCandidateIds(String candidateIds) {
		this.candidateIds = candidateIds;
	}
	public Task getTask() {
		return task;
	}
	public void setTask(Task task) {
		this.task = task;
	}
	
	public org.activiti.engine.runtime.ProcessInstance getProcessInstance() {
		return processInstance;
	}
	public void setProcessInstance(org.activiti.engine.runtime.ProcessInstance processInstance) {
		this.processInstance = processInstance;
	}
	public HistoricProcessInstance getHistoricProcessInstance() {
		return historicProcessInstance;
	}
	public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
		this.historicProcessInstance = historicProcessInstance;
	}
	public HistoricTaskInstance getHistoricTaskInstance() {
		return historicTaskInstance;
	}
	public void setHistoricTaskInstance(HistoricTaskInstance historicTaskInstance) {
		this.historicTaskInstance = historicTaskInstance;
	}
	public ProcessDefinition getProcessDefinition() {
		return processDefinition;
	}
	public void setProcessDefinition(ProcessDefinition processDefinition) {
		this.processDefinition = processDefinition;
	}
	public String getPrevUserid() {
		return prevUserid;
	}
	public void setPrevUserid(String prevUserid) {
		this.prevUserid = prevUserid;
	}
	public Integer getStatus_() {
		return status_;
	}
	public void setStatus_(Integer status_) {
		this.status_ = status_;
	}
	public String getProcessInstanceId_() {
		return processInstanceId_;
	}
	public void setProcessInstanceId_(String processInstanceId_) {
		this.processInstanceId_ = processInstanceId_;
	}
	public Date getStartTime_() {
		return startTime_;
	}
	public void setStartTime_(Date startTime_) {
		this.startTime_ = startTime_;
	}
	public Date getEndTime_() {
		return endTime_;
	}
	public void setEndTime_(Date endTime_) {
		this.endTime_ = endTime_;
	}
	public String getDeleteReason_() {
		return deleteReason_;
	}
	public void setDeleteReason_(String deleteReason_) {
		this.deleteReason_ = deleteReason_;
	}
	public Integer getVersion_() {
		return version_;
	}
	public void setVersion_(Integer version_) {
		this.version_ = version_;
	}
	public String getAssigneeOrCandidateUser() {
		return assigneeOrCandidateUser;
	}
	public void setAssigneeOrCandidateUser(String assigneeOrCandidateUser) {
		this.assigneeOrCandidateUser = assigneeOrCandidateUser;
	}
	
	
}
